<?php

namespace app\library\Points\Triggers;

use app\library\Points\Db;
use app\library\Points\Points;
/**
 * 积分触发器
 *
 * @author wangchanghong
 */
abstract class TriggerAbstracte extends Db{
    abstract function trigger($points_log);
    
    /**
     * 添加积分
     * 
     * @param type $pid
     * @param type $mid
     * @param type $points
     * @param type $order_num
     * @param type $remark
     * @param type $type
     */
    function addPoints($pid, $mid, $points, $order_num, $remark, $type){
        Points::getInstance()->add($pid, $mid, $points, $order_num, $remark, $type);
    }
    
    /**
     * 减少积分
     * 
     * @param type $pid
     * @param type $mid
     * @param type $points
     * @param type $order_num
     * @param type $remark
     * @param type $type
     */
    function reducePoints($pid, $mid, $points, $order_num, $remark, $type){
        Points::getInstance()->reduce($pid, $mid, $points, $order_num, $remark, $type);
    }
}
